﻿<UserControl 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  
    x:Class="WGM_Silverlight.Controls.ChatControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
    >
    <UserControl.Resources>
        <Storyboard x:Name="_animEnter">
            <DoubleAnimation To="0.7" FillBehavior="HoldEnd" Storyboard.TargetName="_largeDisplayImage" Storyboard.TargetProperty="Opacity"
                                     Duration="0:0:0.1"/>
        </Storyboard>
        <Storyboard x:Name="_animLeave">
            <DoubleAnimation To="0" FillBehavior="HoldEnd" Storyboard.TargetName="_largeDisplayImage" Storyboard.TargetProperty="Opacity"
                                     Duration="0:0:0.4"/>
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="100*" />
            <RowDefinition Height="50*"/>
            <RowDefinition Height="16"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Name="_contactInfoPanel" MouseEnter="OnContactInfoMouseEnter" MouseLeave="OncontactInfoMouseLeave">
            <StackPanel VerticalAlignment="Center" >
                <TextBlock Name="_contactNameTb" MaxWidth="200" FontSize="14" Foreground="White" FontFamily="Verdana"/>
                <TextBlock Name="_contactStatusTb" MaxWidth="200" Margin="5,0,0,0" FontSize="10" Foreground="White" FontFamily="Verdana" FontStyle="Italic" />
            </StackPanel>
            <Border Width="45" Height="45" CornerRadius="4" >
                <Border.Background>
                    <ImageBrush ImageSource="../Images/mainicon2.png" x:Name="_contactImageBrush" Stretch="UniformToFill" />
                </Border.Background>
            </Border>

        </StackPanel>
        <Border Name="_largeDisplayImage" Margin="5" Width="200" Height="200" Opacity="0" Grid.Row="1" HorizontalAlignment="Right" Canvas.ZIndex="1" CornerRadius="5">
            <Border.Background>
                <ImageBrush x:Name="_largeDispayImageBrush"/>
            </Border.Background>
        </Border>
        <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled" x:Name="_incomingMessageScroller" VerticalScrollBarVisibility="Auto" Style="{StaticResource ScrollViewerStyle1}" Background="White">
            <StackPanel x:Name="_incomingBlocks"/>
        </ScrollViewer>
        <controls:GridSplitter Grid.Row="1" HorizontalAlignment="Stretch"  Height="2"  VerticalAlignment="Bottom" IsTabStop="False" >
            <controls:GridSplitter.Background>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="White" Offset="0.3"/>
                    <GradientStop Color="#FF000000" Offset="0.5"/>
                    <GradientStop Color="White" Offset="0.7"/>
                </LinearGradientBrush>
            </controls:GridSplitter.Background>
        </controls:GridSplitter>
        <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" x:Name="_outgoingMessageScroller" VerticalScrollBarVisibility="Auto" Style="{StaticResource ScrollViewerStyle1}" Background="White">
            <TextBox Name="_outgoingTb" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextWrapping="Wrap" AcceptsReturn="True"  BorderThickness="0" KeyUp="OnOutgoingKeyUp" />
        </ScrollViewer>
        <Grid Background="White" HorizontalAlignment="Stretch" Grid.Row="3" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Cursor="Hand" FontFamily="Verdana" FontSize="10" Text="Clear Messages" Name="_clearMessagesBtn" MouseLeftButtonDown="OnClearMessages" HorizontalAlignment="Left"/>
            <CheckBox Grid.Column="1" Margin="10,0,0,0"  Name="_autoScrollCheck" IsChecked="True" HorizontalAlignment="Right" >
                <TextBlock Text="Auto Scroll Messages" FontSize="10" FontFamily="Verdana"/>
            </CheckBox>
        </Grid>
    </Grid>
</UserControl>
